﻿package vklib 
{
	import flash.display.Loader;
	import flash.net.URLRequest;
	import flash.system.LoaderContext;
	import flash.system.ApplicationDomain;
	/**
	 * ...
	 * @author apisoc@gmail.com
	 */
	public class LoaderResult extends ResultBase
	{
		private var _req:URLRequest = new URLRequest();
		private var _context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
		
		public function LoaderResult(url:String)
		{
			_req.url = url;
		}
		
		public override function load():void
		{
			try {
				var loader:Loader = new Loader();
				init(loader.contentLoaderInfo);
				loader.load(_req, _context);
			} catch (e:Error) {
				VkApi.debug(e, this);
			}
		}
	}

}